/**
* @file main.cpp
*
* Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <iostream>
#include <cstring>
#include <memory>
#include "sample_process.h"
#include "utils.h"

#include "tcp_server.h"
#include "tcp_client.h"

using namespace std;
bool g_isDevice = false;

int main(int argc, char* argv[])
{
    if (strcmp(argv[1], "client") == 0) {
        // startTcpClient();
        sendToRadarLab();
        return 0;
    }
    SampleProcess sampleProcess;
    Result ret = sampleProcess.InitResource();
    if (ret != SUCCESS) {
        ERROR_LOG("sample init resource failed");
        return FAILED;
    }

    ret = sampleProcess.Process();
    if (ret != SUCCESS) {
        ERROR_LOG("sample process failed");
        return FAILED;
    }

    INFO_LOG("execute sample success");
    return SUCCESS;
}